# import f1


# print(f1.sum(1,2,3))
# args->(1, 2, 3),type-><class 'tuple'>
# 6

def f1(a):
    print(f"f1中a的值: {a}, a的地址: {id(a)}")
    a += 1
    print(f"计算后f1中a的值: {a}, a的地址: {id(a)}")


# a = 10
# print(f"调用f1前a的值: {a}, a的地址: {id(a)}")
#
# f1(a)
# print(f"调用f1后a的值: {a}, a的地址: {id(a)}")
# 调用f1前a的值: 10, a的地址: 2332581063248
# f1中a的值: 10, a的地址: 2332581063248
# 计算后f1中a的值: 11, a的地址: 2332581063280
# 调用f1后a的值: 10, a的地址: 2332581063248



def f2(name):
    print(f"f2中name的值: {name}, a的地址: {id(name)}")
    name += " hi"
    print(f"计算后f1中a的值: {name}, a的地址: {id(name)}")


# name = "tom"
# print(f"调用f2前name的值: {name}, name的地址: {id(name)}")
#
# f2(name)
# print(f"调用f2后name的值: {name}, name的地址: {id(name)}")

# 调用f2前name的值: tom, name的地址: 2514999697008
# f2中name的值: tom, a的地址: 2514999697008
# 计算后f1中a的值: tom hi, a的地址: 2515031253424
# 调用f2后name的值: tom, name的地址: 2514999697008


def fib(n):
    if n == 1 or n == 2:
        return 1
    return fib(n-1) + fib(n-2)


# print(fib(7)) # 13

def eat(n,num):
    if n == 1:
        return num
    return eat(n-1, (num + 1) * 2)


# print(eat(10, 1)) # 1534
#
# num = 1534
# n = 9
# while n > 0:
#     num /= 2
#     num -= 1
#     n -= 1
# print(num)

